#ifndef __GRAPH_H__
#define __GRAPH_H__



#define KB_UP       0x0000
#define KB_DOWN     0x0001
#define KB_LEFT     0x0002
#define KB_RIGHT    0x0003

#define KB_ESC      0x0010
#define KB_RETURN   0x0011
#define KB_SPACE    0x0012


#define KB_DEFAULT  0xFFFF






int KeyBoardInput();

/*
 * Function: MovePen
 * Usage: MovePen(x, y);
 * ---------------------
 * This procedure moves the current point to the position
 * (x, y), without drawing a line.  The model is that of
 * the pen being lifted off the graphics window surface and
 * then moved to its new position.
 */

void MovePen(int x, int y);


/* 画一个矩形 */
void drawRectangle(int x, int y, int w, int h);



/* 
 * 作用：格式化输出文本
 * 用法：drawLabel(x, y, w, {0,-1,1}, {0,1} );
 * -----------------------------
 * @param align -文本对齐方式
 * 0   居中对齐 
 * -1   左对齐
 * 1    右对齐
 * @param fillflag -背景填充标志
 * 0   不填充
 * 1   填充
 */
void drawLabel(int x, int y, int w, int align, const char *text, int fillflag);



/*
 * 作用；设置/获取字体的颜色
 * 用法：setFontColor(Red);
 *       color = getFontColor();
 */
void setFontColor(int color);


int getFontColor();



/*
 * 作用；设置/获取字体的颜色
 * 用法：setBgColor(Red);
 *       color = getBgColor();
 */
void setBgColor(int color);


int getBgColor();



/*
 * 换行
 */
void nextLine();


/*
 * 隐藏/显示光标
 */
void HideCursor();
void ShowCursorA();


int s_gets(char buf[], int buflen);


void reFresh( );

void setAtt( char *mode );

#endif